home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / twincobr.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  48KB  |  1,179 lines

  1. /****************************************************************************
  2.  
  3.         ToaPlan game hardware from 1987
  4.         -------------------------------
  5.         Driver by: Quench
  6.         Flying Shark details: Carl-Henrik Skårstedt  &  Magnus Danielsson
  7.         Flying Shark bootleg info: Ruben Panossian
  8.  
  9.  
  10. Supported games:
  11.  
  12.     Toaplan Board Number:    TP-007
  13.     Taito game number:        B02
  14.         Flying Shark (World)
  15.         Sky Shark (USA Romstar license)
  16.         Hishou Zame (Flying Shark Japan license)
  17.         Flying Shark bootleg (USA Romstar license)
  18.  
  19.     Toaplan Board Number:    TP-011
  20.     Taito game number:        B30
  21.         Twin Cobra (World)
  22.         Twin Cobra (USA license)
  23.         Kyukyoku Tiger (Japan license)
  24.  
  25. Difference between Twin Cobra and Kyukyoko Tiger:
  26.     T.C. supports two simultaneous players.
  27.     K.T. supports two players, but only one at a time.
  28.          for this reason, it also supports Table Top cabinets.
  29.     T.C. stores 3 characters for high scores.
  30.     K.T. stores 6 characters for high scores.
  31.     T.C. heros are Red and Blue for player 1 and 2 respectively.
  32.     K.T. heros are grey for both players.
  33.     T.C. dead remains of ground tanks are circular.
  34.     K.T. dead remains of ground tanks always vary in shape.
  35.     T.C. does not use DSW1-1 and DSW2-8.
  36.     K.T. uses DSW1-1 for cabinet type, and DSW2-8 for allow game continue.
  37.     T.C. continues new hero and continued game at current position.
  38.     K.T. continues new hero and continued game at predefined positions.
  39.          After dying, and your new hero appears, if you do not travel more
  40.          than your helicopter length forward, you are penalised and moved
  41.          back further when your next hero appears.
  42.     K.T. Due to this difference in continue sequence, Kyukyoko Tiger is MUCH
  43.          harder, challenging, and nearly impossible to complete !
  44.  
  45. **************************** Memory & I/O Maps *****************************
  46. 68000: Main CPU
  47.  
  48. 00000-1ffff ROM for Flying Shark
  49. 00000-2ffff ROM for Twin Cobra
  50. 30000-33fff RAM shared with TMS320C10NL-14 protection microcontroller
  51. 40000-40fff RAM sprite display properties (co-ordinates, character, color - etc)
  52. 50000-50dff Palette RAM
  53. 7a000-7abff RAM shared with Z80; 16-bit on this side, 8-bit on Z80 side
  54.  
  55. read:
  56. 78001        DSW1 (Flying Shark)
  57. 78003        DSW2 (Flying Shark)
  58.  
  59. 78005        Player 1 Joystick and Buttons input port
  60. 78007        Player 2 Joystick and Buttons input port
  61. 78009        bit 7 vblank, coin and control/service inputs (Flying shark)
  62.                 Flying Shark implements Tilt as 'freeze system' and also has
  63.                 a reset button, but its not implelemted here (not needed)
  64.  
  65. 7e000-7e005 read data from video RAM (see below)
  66.  
  67. write:
  68. 60000-60003 CRT 6845 controller. 0 = register offset , 2 = register data
  69. 70000-70001 scroll   y   for character page (centre normally 0x01c9)
  70. 70002-70003 scroll < x > for character page (centre normally 0x00e2)
  71. 70004-70005 offset in character page to write character (7e000)
  72.  
  73. 72000-72001 scroll   y   for foreground page (starts from     0x03c9)
  74. 72002-72003 scroll < x > for foreground page (centre normally 0x002a)
  75. 72004-72005 offset in character page to write character (7e002)
  76.  
  77. 74000-74001 scroll   y   for background page (starts from     0x03c9)
  78. 74002-74003 scroll < x > for background page (centre normally 0x002a)
  79. 74004-74005 offset in character page to write character (7e004)
  80.  
  81. 76000-76003 as above but for another layer maybe ??? (Not used here)
  82. 7800a        This activates INT line for Flying shark. (Not via 7800C)
  83.             00        Activate INTerrupt line to the TMS320C10 DSP.
  84.             01        Inhibit  INTerrupt line to the TMS320C10 DSP.
  85.  
  86. 7800c        Control register (Byte write access).
  87.             bits 7-4 always 0
  88.             bits 3-1 select the control signal to drive.
  89.             bit   0  is the value passed to the control signal.
  90.  
  91.             Value (hex):
  92.             00-03    ????
  93.             04        Clear IPL2 line to 68000 inactive hi (Interrupt priority 4)
  94.             05        Set   IPL2 line to 68000 active  low (Interrupt priority 4)
  95.             06        Dont flip display
  96.             07        Flip display
  97.             08        Switch to background layer ram bank 0
  98.             09        Switch to background layer ram bank 1
  99.             0A        Switch to foreground layer rom bank 0
  100.             0B        Switch to foreground layer rom bank 1
  101.             0C        Activate INTerrupt line to the TMS320C10 DSP  (Twin Cobra)
  102.             0D        Inhibit  INTerrupt line to the TMS320C10 DSP  (Twin Cobra)
  103.             0E        Turn screen off
  104.             0F        Turn screen on
  105.  
  106. 7e000-7e001 data to write in text video RAM (70000)
  107. 7e002-7e003 data to write in bg video RAM (72004)
  108. 7e004-7e005 data to write in fg video RAM (74004)
  109.  
  110. Z80: Sound CPU
  111. 0000-7fff ROM
  112. 8000-87ff shared with 68000; 8-bit on this side, 16-bit on 68000 side
  113.  
  114. in:
  115. 00          YM3812 status
  116. 10          Coin inputs and control/service inputs (Twin Cobra)
  117. 40          DSW1 (Twin Cobra)
  118. 50          DSW2 (Twin Cobra)
  119.  
  120. out:
  121. 00          YM3812 control
  122. 01          YM3812 data
  123. 20          Coin counters / Coin lockouts
  124.  
  125. TMS320C10 DSP: Harvard type architecture. RAM and ROM on seperate data buses.
  126. 0000-07ff ROM (words)
  127. 0000-0090 Internal RAM (words).    Moved to 8000-8120 for MAME compatibility.
  128.                                 View this memory in the debugger at 4000h
  129.  
  130. in:
  131. 01          data read from addressed 68K address space (Main RAM/Sprite RAM)
  132.  
  133. out:
  134. 00          address of 68K to read/write to
  135. 01          data to write to addressed 68K address space (Main RAM/Sprite RAM)
  136. 03          bit 15 goes to BIO line of TMS320C10. BIO is a polled input line.
  137.  
  138.  
  139. MCUs used with this hardware: (TMS320C10 in custom Toaplan/Taito disguise)
  140.  
  141. Twin Cobra                    Sky Shark                    Wardner
  142. D70016U                        D70012U                      D70012U
  143. GXC-04                        GXC-02                        GXC-02
  144. MCU (delta) 74000            MCU 71400                    MCU (delta) 71900
  145.  
  146.  
  147.  
  148. 68K writes the following to $30000 to tell DSP to do the following:
  149. Twin  Kyukyoku
  150. Cobra Tiger
  151. 00        00     do nothing
  152. 01        0C     run self test, and report DSP ROM checksum        from 68K PC:23CA6
  153. 02        07     control all enemy shots                        from 68K PC:23BFA
  154. 04        0B     start the enemy helicopters                    from 68K PC:23C66
  155. 05        08     check for colision with enemy fire ???            from 68K PC:23C20
  156. 06        09     check for colision with enemy ???                from 68K PC:23C44
  157. 07        01     control enemy helicopter shots                    from 68K PC:23AB2
  158. 08        02     control all ground enemy shots
  159. 0A        04     read hero position and send enemy to it ?        from 68K PC:23B58
  160.  
  161. 03        0A    \
  162. 09        03     \ These functions within the DSP never seem to be called ????
  163. 0B        05     /
  164. 0C        06    /
  165.  
  166. 68K writes the following to $30004 to tell DSP to do the following:
  167. Flying    Hishou
  168. Shark    Zame
  169. 00        00     do nothing
  170. 03        0B     Write sprite to sprite RAM
  171. 05        01     Get angle
  172. 06        02     Rotate towards direction
  173. 09        05     Check collision between 2 spheres!??
  174. 0A        06     Polar coordinates add
  175. 0B        07     run self test, and report DSP ROM checksum
  176.  
  177. 01        09    \
  178. 02        0A     \
  179. 04        08      > These functions within the DSP never seem to be called ????
  180. 07        03     /
  181. 08        04    /
  182. *****************************************************************************/
  183.  
  184.  
  185.  
  186. #include "driver.h"
  187. #include "vidhrdw/generic.h"
  188. #include "cpu/m68000/m68000.h"
  189.  
  190. /**************** Machine stuff ******************/
  191. void fsharkbt_reset_8741_mcu(void);
  192. READ_HANDLER( fsharkbt_dsp_r );
  193. WRITE_HANDLER( fshark_coin_dsp_w );
  194. READ_HANDLER( twincobr_dsp_r );
  195. WRITE_HANDLER( twincobr_dsp_w );
  196. READ_HANDLER( twincobr_68k_dsp_r );
  197. WRITE_HANDLER( twincobr_68k_dsp_w );
  198. READ_HANDLER( twincobr_7800c_r );
  199. WRITE_HANDLER( twincobr_7800c_w );
  200. READ_HANDLER( twincobr_sharedram_r );
  201. WRITE_HANDLER( twincobr_sharedram_w );
  202.  
  203. extern unsigned char *twincobr_68k_dsp_ram;
  204. extern unsigned char *twincobr_sharedram;
  205. extern int twincobr_intenable;
  206.  
  207.  
  208. /**************** Video stuff ******************/
  209. READ_HANDLER( twincobr_crtc_r );
  210. WRITE_HANDLER( twincobr_crtc_w );
  211.  
  212. WRITE_HANDLER( twincobr_txscroll_w );
  213. WRITE_HANDLER( twincobr_bgscroll_w );
  214. WRITE_HANDLER( twincobr_fgscroll_w );
  215. WRITE_HANDLER( twincobr_exscroll_w );
  216. int  twincobr_txoffs_r(void);
  217. WRITE_HANDLER( twincobr_txoffs_w );
  218. WRITE_HANDLER( twincobr_bgoffs_w );
  219. WRITE_HANDLER( twincobr_fgoffs_w );
  220. READ_HANDLER( twincobr_txram_r );
  221. READ_HANDLER( twincobr_bgram_r );
  222. READ_HANDLER( twincobr_fgram_r );
  223. WRITE_HANDLER( twincobr_txram_w );
  224. WRITE_HANDLER( twincobr_bgram_w );
  225. WRITE_HANDLER( twincobr_fgram_w );
  226.  
  227. int  twincobr_vh_start(void);
  228. void twincobr_vh_stop(void);
  229. void twincobr_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  230. void twincobr_eof_callback(void);
  231.  
  232.  
  233.  
  234. static int twincobr_interrupt(void)
  235. {
  236.     if (twincobr_intenable) {
  237.         twincobr_intenable = 0;
  238.         return MC68000_IRQ_4;
  239.     }
  240.     else return MC68000_INT_NONE;
  241. }
  242.  
  243. static struct MemoryReadAddress readmem[] =
  244. {
  245.     { 0x000000, 0x02ffff, MRA_ROM },
  246.     { 0x030000, 0x033fff, twincobr_68k_dsp_r },        /* 68K and DSP shared RAM */
  247.     { 0x040000, 0x040fff, MRA_BANK1 },                /* sprite ram data */
  248.     { 0x050000, 0x050dff, paletteram_word_r },
  249.     { 0x078000, 0x078001, input_port_3_r },            /* Flying Shark - DSW A */
  250.     { 0x078002, 0x078003, input_port_4_r },            /* Flying Shark - DSW B */
  251.     { 0x078004, 0x078005, input_port_1_r },            /* Player 1 inputs */
  252.     { 0x078006, 0x078007, input_port_2_r },            /* Player 2 inputs */
  253.     { 0x078008, 0x078009, input_port_0_r },            /* V-Blank & FShark Coin/Start */
  254.     { 0x07a000, 0x07abff, twincobr_sharedram_r },    /* 16-bit on 68000 side, 8-bit on Z80 side */
  255.     { 0x07e000, 0x07e001, twincobr_txram_r },        /* data from text video RAM */
  256.     { 0x07e002, 0x07e003, twincobr_bgram_r },        /* data from bg video RAM */
  257.     { 0x07e004, 0x07e005, twincobr_fgram_r },        /* data from fg video RAM */
  258.     { -1 }  /* end of table */
  259. };
  260.  
  261. static struct MemoryWriteAddress writemem[] =
  262. {
  263.     { 0x000000, 0x02ffff, MWA_ROM },
  264.     { 0x030000, 0x033fff, twincobr_68k_dsp_w, &twincobr_68k_dsp_ram },    /* 68K and DSP shared RAM */
  265.     { 0x040000, 0x040fff, MWA_BANK1, &spriteram, &spriteram_size },        /* sprite ram data */
  266.     { 0x050000, 0x050dff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  267.     { 0x060000, 0x060003, twincobr_crtc_w },        /* 6845 CRT controller */
  268.     { 0x070000, 0x070003, twincobr_txscroll_w },    /* text layer scroll */
  269.     { 0x070004, 0x070005, twincobr_txoffs_w },        /* offset in text video RAM */
  270.     { 0x072000, 0x072003, twincobr_bgscroll_w },    /* bg layer scroll */
  271.     { 0x072004, 0x072005, twincobr_bgoffs_w },        /* offset in bg video RAM */
  272.     { 0x074000, 0x074003, twincobr_fgscroll_w },    /* fg layer scroll */
  273.     { 0x074004, 0x074005, twincobr_fgoffs_w },        /* offset in fg video RAM */
  274.     { 0x076000, 0x076003, twincobr_exscroll_w },    /* Spare layer scroll */
  275.     { 0x07800a, 0x07800b, fshark_coin_dsp_w },        /* Flying Shark DSP Comms & coin stuff */
  276.     { 0x07800c, 0x07800d, twincobr_7800c_w },        /* Twin Cobra DSP Comms & system control */
  277.     { 0x07a000, 0x07afff, twincobr_sharedram_w },    /* 16-bit on 68000 side, 8-bit on Z80 side */
  278.     { 0x07e000, 0x07e001, twincobr_txram_w },        /* data for text video RAM */
  279.     { 0x07e002, 0x07e003, twincobr_bgram_w },        /* data for bg video RAM */
  280.     { 0x07e004, 0x07e005, twincobr_fgram_w },        /* data for fg video RAM */
  281.     { -1 }    /* end of table */
  282. };
  283.  
  284. static struct MemoryReadAddress sound_readmem[] =
  285. {
  286.     { 0x0000, 0x7fff, MRA_ROM },
  287.     { 0x8000, 0x87ff, MRA_RAM },
  288.     { -1 }    /* end of table */
  289. };
  290.  
  291. static struct MemoryWriteAddress sound_writemem[] =
  292. {
  293.     { 0x0000, 0x7fff, MWA_ROM },
  294.     { 0x8000, 0x87ff, MWA_RAM, &twincobr_sharedram },
  295.     { -1 }    /* end of table */
  296. };
  297.  
  298. static struct IOReadPort sound_readport[] =
  299. {
  300.     { 0x00, 0x00, YM3812_status_port_0_r },
  301.     { 0x10, 0x10, input_port_5_r },        /* Twin Cobra - Coin/Start */
  302.     { 0x40, 0x40, input_port_3_r },        /* Twin Cobra - DSW A */
  303.     { 0x50, 0x50, input_port_4_r },        /* Twin Cobra - DSW B */
  304.     { -1 }    /* end of table */
  305. };
  306.  
  307. static struct IOWritePort sound_writeport[] =
  308. {
  309.     { 0x00, 0x00, YM3812_control_port_0_w },
  310.     { 0x01, 0x01, YM3812_write_port_0_w },
  311.     { 0x20, 0x20, fshark_coin_dsp_w },        /* Twin Cobra coin count-lockout */
  312.     { -1 }    /* end of table */
  313. };
  314.  
  315. static struct MemoryReadAddress DSP_readmem[] =
  316. {
  317.     { 0x0000, 0x0fff, MRA_ROM },    /* 0x800 words */
  318.     { 0x8000, 0x811f, MRA_RAM },    /* The real DSP has this at address 0 */
  319.                                     /* View this at 4000h in the debugger */
  320.     { -1 }    /* end of table */
  321. };
  322.  
  323. static struct MemoryWriteAddress DSP_writemem[] =
  324. {
  325.     { 0x0000, 0x0fff, MWA_ROM },    /* 0x800 words */
  326.     { 0x8000, 0x811f, MWA_RAM },    /* The real DSP has this at address 0 */
  327.                                     /* View this at 4000h in the debugger */
  328.     { -1 }    /* end of table */
  329. };
  330.  
  331. static struct IOReadPort DSP_readport[] =
  332. {
  333.     { 0x01, 0x01, twincobr_dsp_r },
  334.     { 0x02, 0x02, fsharkbt_dsp_r },
  335.     { -1 }    /* end of table */
  336. };
  337.  
  338. static struct IOWritePort DSP_writeport[] =
  339. {
  340.     { 0x00, 0x03, twincobr_dsp_w },
  341.     { -1 }    /* end of table */
  342. };
  343.  
  344.  
  345. /*****************************************************************************
  346.     Input Port definitions
  347. *****************************************************************************/
  348.  
  349. #define  TOAPLAN_PLAYER_INPUT( player )                                         \
  350.     PORT_START                                                                  \
  351.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | player ) \
  352.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | player ) \
  353.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | player ) \
  354.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | player ) \
  355.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | player)                     \
  356.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | player)                     \
  357.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )                             \
  358.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  359.  
  360. #define  TOAPLAN_JAPAN_DSW_A                            \
  361.     PORT_START        /* DSW A */                            \
  362.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )        \
  363.     PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )        \
  364.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )        \
  365.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )    \
  366.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  367.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )            \
  368.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )    \
  369.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  370.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )            \
  371.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )    \
  372.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )            \
  373.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )            \
  374.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )        \
  375.     PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )        \
  376.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )        \
  377.     PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )        \
  378.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )        \
  379.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )        \
  380.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )        \
  381.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )        \
  382.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) )        \
  383.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  384.  
  385. #define  TWINCOBR_VBLANK_INPUT                        \
  386.     PORT_START                                        \
  387.     PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNKNOWN )    \
  388.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  389.  
  390. #define  TWINCOBR_SYSTEM_INPUTS                            \
  391.     PORT_START                                            \
  392.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )            \
  393.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )            \
  394.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )    \
  395.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  396.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )            \
  397.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )            \
  398.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )            \
  399.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )        \
  400.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )        \
  401.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  402.  
  403. #define TWINCOBR_DSW_B        /* not KTIGER */            \
  404.     PORT_START        /* DSW B */                            \
  405.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )    \
  406.     PORT_DIPSETTING(    0x01, "Easy" )                    \
  407.     PORT_DIPSETTING(    0x00, "Normal" )                \
  408.     PORT_DIPSETTING(    0x02, "Hard" )                    \
  409.     PORT_DIPSETTING(    0x03, "Hardest" )                \
  410.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )    \
  411.     PORT_DIPSETTING(    0x00, "50K, then every 150K" )    \
  412.     PORT_DIPSETTING(    0x04, "70K, then every 200K" )    \
  413.     PORT_DIPSETTING(    0x08, "50000" )                    \
  414.     PORT_DIPSETTING(    0x0c, "100000" )                \
  415.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )        \
  416.     PORT_DIPSETTING(    0x30, "2" )                        \
  417.     PORT_DIPSETTING(    0x00, "3" )                        \
  418.     PORT_DIPSETTING(    0x20, "4" )                        \
  419.     PORT_DIPSETTING(    0x10, "5" )                        \
  420.     PORT_DIPNAME( 0x40, 0x00, "Show DIP SW Settings" )    \
  421.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )            \
  422.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )            \
  423.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )        \
  424.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  425.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  426.  
  427. #define  FSHARK_SYSTEM_INPUTS        /* V-Blank is also here */                 \
  428.     PORT_START                                                                 \
  429.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )                                 \
  430.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )        /* tilt causes freeze */ \
  431.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )    /* reset button */         \
  432.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )                                 \
  433.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )                                 \
  434.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )                             \
  435.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )                             \
  436.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  437.  
  438. #define FSHARK_DSW_B                                    \
  439.     PORT_START        /* DSW B */                            \
  440.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )    \
  441.     PORT_DIPSETTING(    0x01, "Easy" )                    \
  442.     PORT_DIPSETTING(    0x00, "Normal" )                \
  443.     PORT_DIPSETTING(    0x02, "Hard" )                    \
  444.     PORT_DIPSETTING(    0x03, "Hardest" )                \
  445.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )    \
  446.     PORT_DIPSETTING(    0x00, "50K, then every 150K" )    \
  447.     PORT_DIPSETTING(    0x04, "70K, then every 200K" )    \
  448.     PORT_DIPSETTING(    0x08, "50000" )                    \
  449.     PORT_DIPSETTING(    0x0c, "100000" )                \
  450.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )        \
  451.     PORT_DIPSETTING(    0x20, "1" )                        \
  452.     PORT_DIPSETTING(    0x30, "2" )                        \
  453.     PORT_DIPSETTING(    0x00, "3" )                        \
  454.     PORT_DIPSETTING(    0x10, "5" )                        \
  455.     PORT_DIPNAME( 0x40, 0x00, "Show DIP SW Settings" )    \
  456.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )            \
  457.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )            \
  458.     PORT_DIPNAME( 0x80, 0x80, "Allow Continue" )        \
  459.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )            \
  460.     PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
  461.  
  462.  
  463.  
  464.  
  465. INPUT_PORTS_START( twincobr )
  466.     TWINCOBR_VBLANK_INPUT
  467.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER1 )
  468.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER2 )
  469.  
  470.     PORT_START        /* DSW A */
  471.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  472.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  473.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  474.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
  475.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  476.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  477.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )
  478.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  479.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  480.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
  481.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  482.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  483.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
  484.     PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
  485.     PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
  486.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  487.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  488.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  489.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  490.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
  491.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
  492.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
  493.  
  494.     TWINCOBR_DSW_B
  495.     TWINCOBR_SYSTEM_INPUTS
  496. INPUT_PORTS_END
  497.  
  498. INPUT_PORTS_START( twincobu )
  499.     TWINCOBR_VBLANK_INPUT
  500.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER1 )
  501.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER2 )
  502.  
  503.     PORT_START        /* DSW A */
  504.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  505.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  506.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  507.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
  508.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  509.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  510.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )
  511.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  512.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  513.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
  514.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  515.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  516.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
  517.     PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
  518.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  519.     PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )
  520.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
  521.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  522.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  523.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  524.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) )
  525.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  526.  
  527.     TWINCOBR_DSW_B
  528.     TWINCOBR_SYSTEM_INPUTS
  529. INPUT_PORTS_END
  530.  
  531. INPUT_PORTS_START( ktiger )
  532.     TWINCOBR_VBLANK_INPUT
  533.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER1 )
  534.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER2 )
  535.     TOAPLAN_JAPAN_DSW_A
  536.  
  537.     PORT_START        /* DSW B */
  538.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
  539.     PORT_DIPSETTING(    0x01, "Easy" )
  540.     PORT_DIPSETTING(    0x00, "Normal" )
  541.     PORT_DIPSETTING(    0x02, "Hard" )
  542.     PORT_DIPSETTING(    0x03, "Hardest" )
  543.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
  544.     PORT_DIPSETTING(    0x00, "70K, then every 200K" )
  545.     PORT_DIPSETTING(    0x04, "50K, then every 150K" )
  546.     PORT_DIPSETTING(    0x08, "100000" )
  547.     PORT_DIPSETTING(    0x0c, "No Extend" )
  548.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
  549.     PORT_DIPSETTING(    0x30, "2" )
  550.     PORT_DIPSETTING(    0x00, "3" )
  551.     PORT_DIPSETTING(    0x20, "4" )
  552.     PORT_DIPSETTING(    0x10, "5" )
  553.     PORT_DIPNAME( 0x40, 0x00, "Show DIP SW Settings" )
  554.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  555.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
  556.     PORT_DIPNAME( 0x80, 0x80, "Allow Continue" )
  557.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  558.     PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
  559.  
  560.     TWINCOBR_SYSTEM_INPUTS
  561. INPUT_PORTS_END
  562.  
  563. INPUT_PORTS_START( fshark )
  564.     FSHARK_SYSTEM_INPUTS
  565.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER1 )
  566.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER2 )
  567.  
  568.     PORT_START        /* DSW A */
  569.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
  570.     PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
  571.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  572.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
  573.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  574.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  575.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )
  576.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  577.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  578.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
  579.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  580.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  581.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
  582.     PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
  583.     PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
  584.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  585.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  586.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  587.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  588.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
  589.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
  590.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
  591.  
  592.     FSHARK_DSW_B
  593. INPUT_PORTS_END
  594.  
  595. INPUT_PORTS_START( skyshark )
  596.     FSHARK_SYSTEM_INPUTS
  597.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER1 )
  598.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER2 )
  599.  
  600.     PORT_START        /* DSW A */
  601.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
  602.     PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
  603.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  604.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
  605.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  606.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  607.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )
  608.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  609.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  610.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
  611.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  612.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  613.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
  614.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  615.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  616.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  617. /*    PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )    Same as previous */
  618.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  619.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  620.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  621.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  622. /*    PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )    Same as previous */
  623.  
  624.     FSHARK_DSW_B
  625. INPUT_PORTS_END
  626.  
  627. INPUT_PORTS_START( hishouza )
  628.     FSHARK_SYSTEM_INPUTS
  629.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER1 )
  630.     TOAPLAN_PLAYER_INPUT( IPF_PLAYER2 )
  631.     TOAPLAN_JAPAN_DSW_A
  632.     FSHARK_DSW_B
  633. INPUT_PORTS_END
  634.  
  635.  
  636. static struct GfxLayout charlayout =
  637. {
  638.     8,8,    /* 8*8 characters */
  639.     2048,    /* 2048 characters */
  640.     3,        /* 3 bits per pixel */
  641.     { 0*2048*8*8, 1*2048*8*8, 2*2048*8*8 },
  642.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  643.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  644.     8*8        /* every char takes 8 consecutive bytes */
  645. };
  646.  
  647. #define TILELAYOUT(NUM) static struct GfxLayout tilelayout_##NUM =  \
  648. {                                                                    \
  649.     8,8,    /* 8*8 tiles */                                            \
  650.     NUM,    /* NUM (4096/8192) tiles */                                \
  651.     4,        /* 4 bits per pixel */                                    \
  652.     { 0*NUM*8*8, 1*NUM*8*8, 2*NUM*8*8, 3*NUM*8*8 },                    \
  653.     { 0, 1, 2, 3, 4, 5, 6, 7 },                                        \
  654.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },                        \
  655.     8*8        /* every tile takes 8 consecutive bytes */                \
  656. }
  657.  
  658. TILELAYOUT(4096);
  659. TILELAYOUT(8192);
  660.  
  661.  
  662. static struct GfxLayout spritelayout =
  663. {
  664.     16,16,    /* 16*16 sprites */
  665.     2048,    /* 2048 sprites */
  666.     4,        /* 4 bits per pixel */
  667.     { 0*2048*32*8, 1*2048*32*8, 2*2048*32*8, 3*2048*32*8 },
  668.     { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
  669.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  670.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
  671.     32*8    /* every sprite takes 32 consecutive bytes */
  672. };
  673.  
  674. static struct GfxDecodeInfo gfxdecodeinfo[] =
  675. {
  676.     { REGION_GFX1, 0x00000, &charlayout,      1536, 32 },    /* colors 1536-1791 */
  677.     { REGION_GFX2, 0x00000, &tilelayout_8192, 1280, 16 },    /* colors 1280-1535 */
  678.     { REGION_GFX3, 0x00000, &tilelayout_4096, 1024, 16 },    /* colors 1024-1079 */
  679.     { REGION_GFX4, 0x00000, &spritelayout,          0, 64 },    /* colors    0-1023 */
  680.     { -1 } /* end of array */
  681. };
  682.  
  683.  
  684.  
  685. /* handler called by the 3812 emulator when the internal timers cause an IRQ */
  686. static void irqhandler(int linestate)
  687. {
  688.     cpu_set_irq_line(1,0,linestate);
  689. }
  690.  
  691. static struct YM3812interface ym3812_interface =
  692. {
  693.     1,                /* 1 chip  */
  694.     28000000/8,        /* 3.5 MHz */
  695.     { 100 },        /* volume */
  696.     { irqhandler },
  697. };
  698.  
  699.  
  700. static struct MachineDriver machine_driver_twincobr =
  701. {
  702.     /* basic machine hardware */
  703.     {
  704.         {
  705.             CPU_M68000,
  706.             28000000/4,            /* 7.0 MHz - Main board Crystal is 28Mhz */
  707.             readmem,writemem,0,0,
  708.             twincobr_interrupt,1
  709.         },
  710.         {
  711.             CPU_Z80,
  712.             28000000/8,            /* 3.5 MHz */
  713.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  714.             ignore_interrupt,0    /* IRQs are caused by the YM3812 */
  715.         },
  716.         {
  717.             CPU_TMS320C10,
  718.             28000000/8,            /* 3.5 MHz */
  719.             DSP_readmem,DSP_writemem,DSP_readport,DSP_writeport,
  720.             ignore_interrupt,0    /* IRQs are caused by 68000 */
  721.         },
  722.     },
  723.     56, DEFAULT_REAL_60HZ_VBLANK_DURATION,  /* frames per second, vblank duration */
  724.     100,                                    /* 100 CPU slices per frame */
  725.     fsharkbt_reset_8741_mcu,        /* Reset fshark bootleg 8741 MCU data */
  726.  
  727.     /* video hardware */
  728.     64*8, 32*8, { 0*8, 40*8-1, 0*8, 30*8-1 },
  729.     gfxdecodeinfo,
  730.     1792, 1792,
  731.     0,    /* No color PROM decode */
  732.  
  733.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  734.     twincobr_eof_callback,
  735.     twincobr_vh_start,
  736.     twincobr_vh_stop,
  737.     twincobr_vh_screenrefresh,
  738.  
  739.     /* sound hardware */
  740.     0,0,0,0,
  741.     {
  742.         {
  743.             SOUND_YM3812,
  744.             &ym3812_interface
  745.         },
  746.     },
  747. };
  748.  
  749.  
  750.  
  751. /***************************************************************************
  752.  
  753.   Game driver(s)
  754.  
  755. ***************************************************************************/
  756.  
  757. ROM_START( twincobr )
  758.     ROM_REGION( 0x30000, REGION_CPU1 )    /* Main 68K code */
  759.     ROM_LOAD_EVEN( "tc16",        0x00000, 0x10000, 0x07f64d13 )
  760.     ROM_LOAD_ODD ( "tc14",        0x00000, 0x10000, 0x41be6978 )
  761.     ROM_LOAD_EVEN( "tc15",        0x20000, 0x08000, 0x3a646618 )
  762.     ROM_LOAD_ODD ( "tc13",        0x20000, 0x08000, 0xd7d1e317 )
  763.  
  764.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  765.     ROM_LOAD( "tc12",            0x00000, 0x08000, 0xe37b3c44 )    /* slightly different from the other two sets */
  766.  
  767.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  768.     ROM_LOAD_EVEN( "dsp_22.bin",    0x0000, 0x0800, 0x79389a71 )
  769.     ROM_LOAD_ODD ( "dsp_21.bin",    0x0000, 0x0800, 0x2d135376 )
  770. /******  The following are from a bootleg board. ******
  771.     A0 and A1 are swapped between the TMS320C10 and these BPROMs on the board.
  772.     ROM_LOAD_EVEN( "tc1b",        0x0000, 0x0800, 0x1757cc33 )
  773.     ROM_LOAD_ODD ( "tc2a",        0x0000, 0x0800, 0xd6d878c9 )
  774. */
  775.  
  776.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  777.     ROM_LOAD( "tc11",            0x00000, 0x04000, 0x0a254133 )
  778.     ROM_LOAD( "tc03",            0x04000, 0x04000, 0xe9e2d4b1 )
  779.     ROM_LOAD( "tc04",            0x08000, 0x04000, 0xa599d845 )
  780.  
  781.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  782.     ROM_LOAD( "tc01",            0x00000, 0x10000, 0x15b3991d )
  783.     ROM_LOAD( "tc02",            0x10000, 0x10000, 0xd9e2e55d )
  784.     ROM_LOAD( "tc06",            0x20000, 0x10000, 0x13daeac8 )
  785.     ROM_LOAD( "tc05",            0x30000, 0x10000, 0x8cc79357 )
  786.  
  787.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  788.     ROM_LOAD( "tc07",            0x00000, 0x08000, 0xb5d48389 )
  789.     ROM_LOAD( "tc08",            0x08000, 0x08000, 0x97f20fdc )
  790.     ROM_LOAD( "tc09",            0x10000, 0x08000, 0x170c01db )
  791.     ROM_LOAD( "tc10",            0x18000, 0x08000, 0x44f5accd )
  792.  
  793.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  794.     ROM_LOAD( "tc20",            0x00000, 0x10000, 0xcb4092b8 )
  795.     ROM_LOAD( "tc19",            0x10000, 0x10000, 0x9cb8675e )
  796.     ROM_LOAD( "tc18",            0x20000, 0x10000, 0x806fb374 )
  797.     ROM_LOAD( "tc17",            0x30000, 0x10000, 0x4264bff8 )
  798.  
  799.     ROM_REGION( 0x260, REGION_PROMS )    /* nibble bproms, lo/hi order to be determined */
  800.     ROM_LOAD( "82s129.d3",    0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  801.     ROM_LOAD( "82s129.d4",    0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  802.     ROM_LOAD( "82s123.d2",    0x200, 0x020, 0xf72482db )    /* sprite control ?? */
  803.     ROM_LOAD( "82s123.e18",    0x220, 0x020, 0xbc88cced )    /* sprite attribute (flip/position) ?? */
  804.     ROM_LOAD( "82s123.b24",    0x240, 0x020, 0x4fb5df2a )    /* tile to sprite priority ?? */
  805. ROM_END
  806.  
  807. ROM_START( twincobu )
  808.     ROM_REGION( 0x30000, REGION_CPU1 )    /* Main 68K code */
  809.     ROM_LOAD_EVEN( "tc16",            0x00000, 0x10000, 0x07f64d13 )
  810.     ROM_LOAD_ODD ( "tc14",            0x00000, 0x10000, 0x41be6978 )
  811.     ROM_LOAD_EVEN( "tcbra26.bin",    0x20000, 0x08000, 0xbdd00ba4 )
  812.     ROM_LOAD_ODD ( "tcbra27.bin",    0x20000, 0x08000, 0xed600907 )
  813.  
  814.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  815.     ROM_LOAD( "b30-05",                0x00000, 0x08000, 0x1a8f1e10 )
  816.  
  817.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  818.     ROM_LOAD_EVEN( "dsp_22.bin",    0x0000, 0x0800, 0x79389a71 )
  819.     ROM_LOAD_ODD ( "dsp_21.bin",    0x0000, 0x0800, 0x2d135376 )
  820.  
  821.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  822.     ROM_LOAD( "tc11",            0x00000, 0x04000, 0x0a254133 )
  823.     ROM_LOAD( "tc03",            0x04000, 0x04000, 0xe9e2d4b1 )
  824.     ROM_LOAD( "tc04",            0x08000, 0x04000, 0xa599d845 )
  825.  
  826.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  827.     ROM_LOAD( "tc01",            0x00000, 0x10000, 0x15b3991d )
  828.     ROM_LOAD( "tc02",            0x10000, 0x10000, 0xd9e2e55d )
  829.     ROM_LOAD( "tc06",            0x20000, 0x10000, 0x13daeac8 )
  830.     ROM_LOAD( "tc05",            0x30000, 0x10000, 0x8cc79357 )
  831.  
  832.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  833.     ROM_LOAD( "tc07",            0x00000, 0x08000, 0xb5d48389 )
  834.     ROM_LOAD( "tc08",            0x08000, 0x08000, 0x97f20fdc )
  835.     ROM_LOAD( "tc09",            0x10000, 0x08000, 0x170c01db )
  836.     ROM_LOAD( "tc10",            0x18000, 0x08000, 0x44f5accd )
  837.  
  838.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  839.     ROM_LOAD( "tc20",            0x00000, 0x10000, 0xcb4092b8 )
  840.     ROM_LOAD( "tc19",            0x10000, 0x10000, 0x9cb8675e )
  841.     ROM_LOAD( "tc18",            0x20000, 0x10000, 0x806fb374 )
  842.     ROM_LOAD( "tc17",            0x30000, 0x10000, 0x4264bff8 )
  843.  
  844.     ROM_REGION( 0x260, REGION_PROMS )    /* nibble bproms, lo/hi order to be determined */
  845.     ROM_LOAD( "82s129.d3",    0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  846.     ROM_LOAD( "82s129.d4",    0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  847.     ROM_LOAD( "82s123.d2",    0x200, 0x020, 0xf72482db )    /* sprite control ?? */
  848.     ROM_LOAD( "82s123.e18",    0x220, 0x020, 0xbc88cced )    /* sprite attribute (flip/position) ?? */
  849.     ROM_LOAD( "82s123.b24",    0x240, 0x020, 0x4fb5df2a )    /* tile to sprite priority ?? */
  850. ROM_END
  851.  
  852. ROM_START( ktiger )
  853.     ROM_REGION( 0x30000, REGION_CPU1 )    /* Main 68K code */
  854.     ROM_LOAD_EVEN( "tc16",        0x00000, 0x10000, 0x07f64d13 )
  855.     ROM_LOAD_ODD ( "tc14",        0x00000, 0x10000, 0x41be6978 )
  856.     ROM_LOAD_EVEN( "b30-02",    0x20000, 0x08000, 0x1d63e9c4 )
  857.     ROM_LOAD_ODD ( "b30-04",    0x20000, 0x08000, 0x03957a30 )
  858.  
  859.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  860.     ROM_LOAD( "b30-05",            0x00000, 0x08000, 0x1a8f1e10 )
  861.  
  862.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  863.     ROM_LOAD_EVEN( "dsp-22",    0x0000, 0x0800, BADCRC( 0x8a1d48d9 ) )
  864.     ROM_LOAD_ODD ( "dsp-21",    0x0000, 0x0800, BADCRC( 0x33d99bc2 ) )
  865.  
  866.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  867.     ROM_LOAD( "tc11",            0x00000, 0x04000, 0x0a254133 )
  868.     ROM_LOAD( "tc03",            0x04000, 0x04000, 0xe9e2d4b1 )
  869.     ROM_LOAD( "tc04",            0x08000, 0x04000, 0xa599d845 )
  870.  
  871.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  872.     ROM_LOAD( "tc01",            0x00000, 0x10000, 0x15b3991d )
  873.     ROM_LOAD( "tc02",            0x10000, 0x10000, 0xd9e2e55d )
  874.     ROM_LOAD( "tc06",            0x20000, 0x10000, 0x13daeac8 )
  875.     ROM_LOAD( "tc05",            0x30000, 0x10000, 0x8cc79357 )
  876.  
  877.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  878.     ROM_LOAD( "tc07",            0x00000, 0x08000, 0xb5d48389 )
  879.     ROM_LOAD( "tc08",            0x08000, 0x08000, 0x97f20fdc )
  880.     ROM_LOAD( "tc09",            0x10000, 0x08000, 0x170c01db )
  881.     ROM_LOAD( "tc10",            0x18000, 0x08000, 0x44f5accd )
  882.  
  883.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  884.     ROM_LOAD( "tc20",            0x00000, 0x10000, 0xcb4092b8 )
  885.     ROM_LOAD( "tc19",            0x10000, 0x10000, 0x9cb8675e )
  886.     ROM_LOAD( "tc18",            0x20000, 0x10000, 0x806fb374 )
  887.     ROM_LOAD( "tc17",            0x30000, 0x10000, 0x4264bff8 )
  888.  
  889.     ROM_REGION( 0x260, REGION_PROMS )    /* nibble bproms, lo/hi order to be determined */
  890.     ROM_LOAD( "82s129.d3",    0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  891.     ROM_LOAD( "82s129.d4",    0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  892.     ROM_LOAD( "82s123.d2",    0x200, 0x020, 0xf72482db )    /* sprite control ?? */
  893.     ROM_LOAD( "82s123.e18",    0x220, 0x020, 0xbc88cced )    /* sprite attribute (flip/position) ?? */
  894.     ROM_LOAD( "82s123.b24",    0x240, 0x020, 0x4fb5df2a )    /* tile to sprite priority ?? */
  895. ROM_END
  896.  
  897. ROM_START( fshark )
  898.     ROM_REGION( 0x20000, REGION_CPU1 )    /* Main 68K code */
  899.     ROM_LOAD_EVEN( "b02_18-1.rom",    0x00000, 0x10000, 0x04739e02 )
  900.     ROM_LOAD_ODD ( "b02_17-1.rom",    0x00000, 0x10000, 0xfd6ef7a8 )
  901.  
  902.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  903.     ROM_LOAD( "b02_16.rom",        0x0000, 0x8000, 0xcdd1a153 )
  904.  
  905.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  906. #ifndef LSB_FIRST
  907.     ROM_LOAD_NIB_HIGH( "82s137-3.mcu",  0x1000, 0x0400, 0x70b537b9 ) /* lsb */
  908.     ROM_LOAD_NIB_LOW ( "82s137-4.mcu",  0x1000, 0x0400, 0x6edb2de8 )
  909.     ROM_LOAD_NIB_HIGH( "82s137-7.mcu",  0x1400, 0x0400, 0xcbf3184b )
  910.     ROM_LOAD_NIB_LOW ( "82s137-8.mcu",  0x1400, 0x0400, 0x8246a05c )
  911.     ROM_LOAD_NIB_HIGH( "82s137-1.mcu",  0x1800, 0x0400, 0xcc5b3f53 ) /* msb */
  912.     ROM_LOAD_NIB_LOW ( "82s137-2.mcu",  0x1800, 0x0400, 0x47351d55 )
  913.     ROM_LOAD_NIB_HIGH( "82s137-5.mcu",  0x1c00, 0x0400, 0xf35b978a )
  914.     ROM_LOAD_NIB_LOW ( "82s137-6.mcu",  0x1c00, 0x0400, 0x0459e51b )
  915. #else
  916.     ROM_LOAD_NIB_HIGH( "82s137-1.mcu",  0x1000, 0x0400, 0xcc5b3f53 ) /* msb */
  917.     ROM_LOAD_NIB_LOW ( "82s137-2.mcu",  0x1000, 0x0400, 0x47351d55 )
  918.     ROM_LOAD_NIB_HIGH( "82s137-5.mcu",  0x1400, 0x0400, 0xf35b978a )
  919.     ROM_LOAD_NIB_LOW ( "82s137-6.mcu",  0x1400, 0x0400, 0x0459e51b )
  920.     ROM_LOAD_NIB_HIGH( "82s137-3.mcu",  0x1800, 0x0400, 0x70b537b9 ) /* lsb */
  921.     ROM_LOAD_NIB_LOW ( "82s137-4.mcu",  0x1800, 0x0400, 0x6edb2de8 )
  922.     ROM_LOAD_NIB_HIGH( "82s137-7.mcu",  0x1c00, 0x0400, 0xcbf3184b )
  923.     ROM_LOAD_NIB_LOW ( "82s137-8.mcu",  0x1c00, 0x0400, 0x8246a05c )
  924. #endif
  925.  
  926.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  927.     ROM_LOAD( "b02_07-1.rom",    0x00000, 0x04000, 0xe669f80e )
  928.     ROM_LOAD( "b02_06-1.rom",    0x04000, 0x04000, 0x5e53ae47 )
  929.     ROM_LOAD( "b02_05-1.rom",    0x08000, 0x04000, 0xa8b05bd0 )
  930.  
  931.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  932.     ROM_LOAD( "b02_12.rom",        0x00000, 0x08000, 0x733b9997 )
  933.         /* 08000-0ffff not used */
  934.     ROM_LOAD( "b02_15.rom",        0x10000, 0x08000, 0x8b70ef32 )
  935.         /* 18000-1ffff not used */
  936.     ROM_LOAD( "b02_14.rom",        0x20000, 0x08000, 0xf711ba7d )
  937.         /* 28000-2ffff not used */
  938.     ROM_LOAD( "b02_13.rom",        0x30000, 0x08000, 0x62532cd3 )
  939.         /* 38000-3ffff not used */
  940.  
  941.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  942.     ROM_LOAD( "b02_08.rom",        0x00000, 0x08000, 0xef0cf49c )
  943.     ROM_LOAD( "b02_11.rom",        0x08000, 0x08000, 0xf5799422 )
  944.     ROM_LOAD( "b02_10.rom",        0x10000, 0x08000, 0x4bd099ff )
  945.     ROM_LOAD( "b02_09.rom",        0x18000, 0x08000, 0x230f1582 )
  946.  
  947.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  948.     ROM_LOAD( "b02_01.512",        0x00000, 0x10000, 0x2234b424 )
  949.     ROM_LOAD( "b02_02.512",        0x10000, 0x10000, 0x30d4c9a8 )
  950.     ROM_LOAD( "b02_03.512",        0x20000, 0x10000, 0x64f3d88f )
  951.     ROM_LOAD( "b02_04.512",        0x30000, 0x10000, 0x3b23a9fc )
  952.  
  953.     ROM_REGION( 0x300, REGION_PROMS )    /* nibble bproms, lo/hi order to be determined */
  954.     ROM_LOAD( "clr2.bpr",    0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  955.     ROM_LOAD( "clr1.bpr",    0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  956.     ROM_LOAD( "clr3.bpr",    0x200, 0x100, 0x016fe2f7 )    /* ?? */
  957. ROM_END
  958.  
  959. ROM_START( skyshark )
  960.     ROM_REGION( 0x20000, REGION_CPU1 )    /* Main 68K code */
  961.     ROM_LOAD_EVEN( "18-2",        0x00000, 0x10000, 0x888e90f3 )
  962.     ROM_LOAD_ODD ( "17-2",        0x00000, 0x10000, 0x066d67be )
  963.  
  964.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  965.     ROM_LOAD( "b02_16.rom",        0x0000, 0x8000, 0xcdd1a153 )
  966.  
  967.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  968. #ifndef LSB_FIRST
  969.     ROM_LOAD_NIB_HIGH( "82s137-3.mcu",  0x1000, 0x0400, 0x70b537b9 ) /* lsb */
  970.     ROM_LOAD_NIB_LOW ( "82s137-4.mcu",  0x1000, 0x0400, 0x6edb2de8 )
  971.     ROM_LOAD_NIB_HIGH( "82s137-7.mcu",  0x1400, 0x0400, 0xcbf3184b )
  972.     ROM_LOAD_NIB_LOW ( "82s137-8.mcu",  0x1400, 0x0400, 0x8246a05c )
  973.     ROM_LOAD_NIB_HIGH( "82s137-1.mcu",  0x1800, 0x0400, 0xcc5b3f53 ) /* msb */
  974.     ROM_LOAD_NIB_LOW ( "82s137-2.mcu",  0x1800, 0x0400, 0x47351d55 )
  975.     ROM_LOAD_NIB_HIGH( "82s137-5.mcu",  0x1c00, 0x0400, 0xf35b978a )
  976.     ROM_LOAD_NIB_LOW ( "82s137-6.mcu",  0x1c00, 0x0400, 0x0459e51b )
  977. #else
  978.     ROM_LOAD_NIB_HIGH( "82s137-1.mcu",  0x1000, 0x0400, 0xcc5b3f53 ) /* msb */
  979.     ROM_LOAD_NIB_LOW ( "82s137-2.mcu",  0x1000, 0x0400, 0x47351d55 )
  980.     ROM_LOAD_NIB_HIGH( "82s137-5.mcu",  0x1400, 0x0400, 0xf35b978a )
  981.     ROM_LOAD_NIB_LOW ( "82s137-6.mcu",  0x1400, 0x0400, 0x0459e51b )
  982.     ROM_LOAD_NIB_HIGH( "82s137-3.mcu",  0x1800, 0x0400, 0x70b537b9 ) /* lsb */
  983.     ROM_LOAD_NIB_LOW ( "82s137-4.mcu",  0x1800, 0x0400, 0x6edb2de8 )
  984.     ROM_LOAD_NIB_HIGH( "82s137-7.mcu",  0x1c00, 0x0400, 0xcbf3184b )
  985.     ROM_LOAD_NIB_LOW ( "82s137-8.mcu",  0x1c00, 0x0400, 0x8246a05c )
  986. #endif
  987.  
  988.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  989.     ROM_LOAD( "7-2",            0x00000, 0x04000, 0xaf48c4e6 )
  990.     ROM_LOAD( "6-2",            0x04000, 0x04000, 0x9a29a862 )
  991.     ROM_LOAD( "5-2",            0x08000, 0x04000, 0xfb7cad55 )
  992.  
  993.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  994.     ROM_LOAD( "b02_12.rom",        0x00000, 0x08000, 0x733b9997 )
  995.         /* 08000-0ffff not used */
  996.     ROM_LOAD( "b02_15.rom",        0x10000, 0x08000, 0x8b70ef32 )
  997.         /* 18000-1ffff not used */
  998.     ROM_LOAD( "b02_14.rom",        0x20000, 0x08000, 0xf711ba7d )
  999.         /* 28000-2ffff not used */
  1000.     ROM_LOAD( "b02_13.rom",        0x30000, 0x08000, 0x62532cd3 )
  1001.         /* 38000-3ffff not used */
  1002.  
  1003.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  1004.     ROM_LOAD( "b02_08.rom",        0x00000, 0x08000, 0xef0cf49c )
  1005.     ROM_LOAD( "b02_11.rom",        0x08000, 0x08000, 0xf5799422 )
  1006.     ROM_LOAD( "b02_10.rom",        0x10000, 0x08000, 0x4bd099ff )
  1007.     ROM_LOAD( "b02_09.rom",        0x18000, 0x08000, 0x230f1582 )
  1008.  
  1009.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  1010.     ROM_LOAD( "b02_01.512",        0x00000, 0x10000, 0x2234b424 )
  1011.     ROM_LOAD( "b02_02.512",        0x10000, 0x10000, 0x30d4c9a8 )
  1012.     ROM_LOAD( "b02_03.512",        0x20000, 0x10000, 0x64f3d88f )
  1013.     ROM_LOAD( "b02_04.512",        0x30000, 0x10000, 0x3b23a9fc )
  1014.  
  1015.     ROM_REGION( 0x300, REGION_PROMS )    /* nibble bproms, lo/hi order to be determined */
  1016.     ROM_LOAD( "clr2.bpr",    0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  1017.     ROM_LOAD( "clr1.bpr",    0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  1018.     ROM_LOAD( "clr3.bpr",    0x200, 0x100, 0x016fe2f7 )    /* ?? */
  1019. ROM_END
  1020.  
  1021. ROM_START( hishouza )
  1022.     ROM_REGION( 0x20000, REGION_CPU1 )    /* Main 68K code */
  1023.     ROM_LOAD_EVEN( "b02-18.rom",    0x00000, 0x10000, 0x4444bb94 )
  1024.     ROM_LOAD_ODD ( "b02-17.rom",    0x00000, 0x10000, 0xcdac7228 )
  1025.  
  1026.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  1027.     ROM_LOAD( "b02_16.rom",        0x0000, 0x8000, 0xcdd1a153 )
  1028.  
  1029.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  1030. #ifndef LSB_FIRST
  1031.     ROM_LOAD_NIB_HIGH( "dsp-a3.bpr", 0x1000, 0x0400, 0xdf88e79b ) /* lsb */
  1032.     ROM_LOAD_NIB_LOW ( "dsp-a4.bpr", 0x1000, 0x0400, 0xa2094a7f )
  1033.     ROM_LOAD_NIB_HIGH( "dsp-b7.bpr", 0x1400, 0x0400, 0xe87540cd )
  1034.     ROM_LOAD_NIB_LOW ( "dsp-b8.bpr", 0x1400, 0x0400, 0xd3c16c5c )
  1035.     ROM_LOAD_NIB_HIGH( "dsp-a1.bpr", 0x1800, 0x0400, 0x45d4d1b1 ) /* msb */
  1036.     ROM_LOAD_NIB_LOW ( "dsp-a2.bpr", 0x1800, 0x0400, 0xedd227fa )
  1037.     ROM_LOAD_NIB_HIGH( "dsp-b5.bpr", 0x1c00, 0x0400, 0x85ca5d47 )
  1038.     ROM_LOAD_NIB_LOW ( "dsp-b6.bpr", 0x1c00, 0x0400, 0x81816b2c )
  1039. #else
  1040.     ROM_LOAD_NIB_HIGH( "dsp-a1.bpr", 0x1000, 0x0400, 0x45d4d1b1 ) /* msb */
  1041.     ROM_LOAD_NIB_LOW ( "dsp-a2.bpr", 0x1000, 0x0400, 0xedd227fa )
  1042.     ROM_LOAD_NIB_HIGH( "dsp-b5.bpr", 0x1400, 0x0400, 0x85ca5d47 )
  1043.     ROM_LOAD_NIB_LOW ( "dsp-b6.bpr", 0x1400, 0x0400, 0x81816b2c )
  1044.     ROM_LOAD_NIB_HIGH( "dsp-a3.bpr", 0x1800, 0x0400, 0xdf88e79b ) /* lsb */
  1045.     ROM_LOAD_NIB_LOW ( "dsp-a4.bpr", 0x1800, 0x0400, 0xa2094a7f )
  1046.     ROM_LOAD_NIB_HIGH( "dsp-b7.bpr", 0x1c00, 0x0400, 0xe87540cd )
  1047.     ROM_LOAD_NIB_LOW ( "dsp-b8.bpr", 0x1c00, 0x0400, 0xd3c16c5c )
  1048. #endif
  1049.  
  1050.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  1051.     ROM_LOAD( "b02-07.rom",        0x00000, 0x04000, 0xc13a775e )
  1052.     ROM_LOAD( "b02-06.rom",        0x04000, 0x04000, 0xad5f1371 )
  1053.     ROM_LOAD( "b02-05.rom",        0x08000, 0x04000, 0x85a7bff6 )
  1054.  
  1055.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  1056.     ROM_LOAD( "b02_12.rom",        0x00000, 0x08000, 0x733b9997 )
  1057.         /* 08000-0ffff not used */
  1058.     ROM_LOAD( "b02_15.rom",        0x10000, 0x08000, 0x8b70ef32 )
  1059.         /* 18000-1ffff not used */
  1060.     ROM_LOAD( "b02_14.rom",        0x20000, 0x08000, 0xf711ba7d )
  1061.         /* 28000-2ffff not used */
  1062.     ROM_LOAD( "b02_13.rom",        0x30000, 0x08000, 0x62532cd3 )
  1063.         /* 38000-3ffff not used */
  1064.  
  1065.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  1066.     ROM_LOAD( "b02_08.rom",        0x00000, 0x08000, 0xef0cf49c )
  1067.     ROM_LOAD( "b02_11.rom",        0x08000, 0x08000, 0xf5799422 )
  1068.     ROM_LOAD( "b02_10.rom",        0x10000, 0x08000, 0x4bd099ff )
  1069.     ROM_LOAD( "b02_09.rom",        0x18000, 0x08000, 0x230f1582 )
  1070.  
  1071.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  1072.     ROM_LOAD( "b02_01.512",        0x00000, 0x10000, 0x2234b424 )
  1073.     ROM_LOAD( "b02_02.512",        0x10000, 0x10000, 0x30d4c9a8 )
  1074.     ROM_LOAD( "b02_03.512",        0x20000, 0x10000, 0x64f3d88f )
  1075.     ROM_LOAD( "b02_04.512",        0x30000, 0x10000, 0x3b23a9fc )
  1076.  
  1077.     ROM_REGION( 0x300, REGION_PROMS )    /* nibble bproms, lo/hi order to be determined */
  1078.     ROM_LOAD( "clr2.bpr",    0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  1079.     ROM_LOAD( "clr1.bpr",    0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  1080.     ROM_LOAD( "clr3.bpr",    0x200, 0x100, 0x016fe2f7 )    /* ?? */
  1081. ROM_END
  1082.  
  1083. ROM_START( fsharkbt )
  1084.     ROM_REGION( 0x20000, REGION_CPU1 )    /* Main 68K code */
  1085.     ROM_LOAD_EVEN( "r18",        0x00000, 0x10000, 0xef30f563 )
  1086.     ROM_LOAD_ODD ( "r17",        0x00000, 0x10000, 0x0e18d25f )
  1087.  
  1088.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  1089.     ROM_LOAD( "b02_16.rom",        0x0000, 0x8000, 0xcdd1a153 )
  1090.  
  1091.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  1092. #ifndef LSB_FIRST
  1093.     ROM_LOAD_NIB_HIGH( "mcu-3.bpr",  0x1000, 0x0400, 0xdf88e79b ) /* lsb */
  1094.     ROM_LOAD_NIB_LOW ( "mcu-4.bpr",  0x1000, 0x0400, 0xa2094a7f )
  1095.     ROM_LOAD_NIB_HIGH( "mcu-7.bpr",  0x1400, 0x0400, 0x0cd30d49 )
  1096.     ROM_LOAD_NIB_LOW ( "mcu-8.bpr",  0x1400, 0x0400, 0x3379bbff )
  1097.     ROM_LOAD_NIB_HIGH( "mcu-1.bpr",  0x1800, 0x0400, 0x45d4d1b1 ) /* msb */
  1098.     ROM_LOAD_NIB_LOW ( "mcu-2.bpr",  0x1800, 0x0400, 0x651336d1 )
  1099.     ROM_LOAD_NIB_HIGH( "mcu-5.bpr",  0x1c00, 0x0400, 0xf97a58da )
  1100.     ROM_LOAD_NIB_LOW ( "mcu-6.bpr",  0x1c00, 0x0400, 0xffcc422d )
  1101. #else
  1102.     ROM_LOAD_NIB_HIGH( "mcu-1.bpr",  0x1000, 0x0400, 0x45d4d1b1 ) /* msb */
  1103.     ROM_LOAD_NIB_LOW ( "mcu-2.bpr",  0x1000, 0x0400, 0x651336d1 )
  1104.     ROM_LOAD_NIB_HIGH( "mcu-5.bpr",  0x1400, 0x0400, 0xf97a58da )
  1105.     ROM_LOAD_NIB_LOW ( "mcu-6.bpr",  0x1400, 0x0400, 0xffcc422d )
  1106.     ROM_LOAD_NIB_HIGH( "mcu-3.bpr",  0x1800, 0x0400, 0xdf88e79b ) /* lsb */
  1107.     ROM_LOAD_NIB_LOW ( "mcu-4.bpr",  0x1800, 0x0400, 0xa2094a7f )
  1108.     ROM_LOAD_NIB_HIGH( "mcu-7.bpr",  0x1c00, 0x0400, 0x0cd30d49 )
  1109.     ROM_LOAD_NIB_LOW ( "mcu-8.bpr",  0x1c00, 0x0400, 0x3379bbff )
  1110. #endif
  1111.  
  1112.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  1113.     ROM_LOAD( "b02_07-1.rom",    0x00000, 0x04000, 0xe669f80e )
  1114.     ROM_LOAD( "b02_06-1.rom",    0x04000, 0x04000, 0x5e53ae47 )
  1115.     ROM_LOAD( "b02_05-1.rom",    0x08000, 0x04000, 0xa8b05bd0 )
  1116.  
  1117.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  1118.     ROM_LOAD( "b02_12.rom",        0x00000, 0x08000, 0x733b9997 )
  1119.         /* 08000-0ffff not used */
  1120.     ROM_LOAD( "b02_15.rom",        0x10000, 0x08000, 0x8b70ef32 )
  1121.         /* 18000-1ffff not used */
  1122.     ROM_LOAD( "b02_14.rom",        0x20000, 0x08000, 0xf711ba7d )
  1123.         /* 28000-2ffff not used */
  1124.     ROM_LOAD( "b02_13.rom",        0x30000, 0x08000, 0x62532cd3 )
  1125.         /* 38000-3ffff not used */
  1126.  
  1127.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  1128.     ROM_LOAD( "b02_08.rom",        0x00000, 0x08000, 0xef0cf49c )
  1129.     ROM_LOAD( "b02_11.rom",        0x08000, 0x08000, 0xf5799422 )
  1130.     ROM_LOAD( "b02_10.rom",        0x10000, 0x08000, 0x4bd099ff )
  1131.     ROM_LOAD( "b02_09.rom",        0x18000, 0x08000, 0x230f1582 )
  1132.  
  1133.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  1134.     ROM_LOAD( "b02_01.512",        0x00000, 0x10000, 0x2234b424 )
  1135.     ROM_LOAD( "b02_02.512",        0x10000, 0x10000, 0x30d4c9a8 )
  1136.     ROM_LOAD( "b02_03.512",        0x20000, 0x10000, 0x64f3d88f )
  1137.     ROM_LOAD( "b02_04.512",        0x30000, 0x10000, 0x3b23a9fc )
  1138.  
  1139.     ROM_REGION( 0x300, REGION_PROMS )    /* nibble bproms, lo/hi order to be determined */
  1140.     ROM_LOAD( "clr2.bpr",    0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  1141.     ROM_LOAD( "clr1.bpr",    0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  1142.     ROM_LOAD( "clr3.bpr",    0x200, 0x100, 0x016fe2f7 )    /* ?? */
  1143. ROM_END
  1144.  
  1145.  
  1146.  
  1147. static void init_fshark(void)
  1148. {
  1149.     int A;
  1150.     unsigned char datamsb;
  1151.     unsigned char datalsb;
  1152.  
  1153.     unsigned char *DSP_ROMS = memory_region(REGION_CPU3);
  1154.  
  1155.     /* The ROM loader fixes the nibble images. Here we fix the byte ordering. */
  1156.  
  1157.     for (A = 0;A < 0x0800;A++)
  1158.     {
  1159.         datamsb = DSP_ROMS[0x1000 + A];
  1160.         datalsb = DSP_ROMS[0x1800 + A];
  1161.         DSP_ROMS[(A*2)]   = datamsb;
  1162.         DSP_ROMS[(A*2)+1] = datalsb;
  1163.  
  1164.         DSP_ROMS[0x1000 + A] = 00;
  1165.         DSP_ROMS[0x1800 + A] = 00;
  1166.     }
  1167. }
  1168.  
  1169.  
  1170.  
  1171. GAME( 1987, twincobr, 0,        twincobr, twincobr, 0,      ROT270, "[Toaplan] Taito Corporation", "Twin Cobra (World)" )
  1172. GAME( 1987, twincobu, twincobr, twincobr, twincobu, 0,      ROT270, "[Toaplan] Taito America Corporation (Romstar license)", "Twin Cobra (US)" )
  1173. GAME( 1987, ktiger,   twincobr, twincobr, ktiger,   0,      ROT270, "[Toaplan] Taito Corporation", "Kyukyoku Tiger (Japan)" )
  1174. GAME( 1987, fshark,   0,        twincobr, fshark,   fshark, ROT270, "[Toaplan] Taito Corporation", "Flying Shark (World)" )
  1175. GAME( 1987, skyshark, fshark,   twincobr, skyshark, fshark, ROT270, "[Toaplan] Taito America Corporation (Romstar license)", "Sky Shark (US)" )
  1176. GAME( 1987, hishouza, fshark,   twincobr, hishouza, fshark, ROT270, "[Toaplan] Taito Corporation", "Hishou Zame (Japan)" )
  1177. GAME( 1987, fsharkbt, fshark,   twincobr, skyshark, fshark, ROT270, "bootleg", "Flying Shark (bootleg)" )
  1178.  
  1179.